package pers.wensheng.patterns.creator_pattern.singleton_pattern.zother;

import java.io.IOException;
import java.io.InputStream;

/**
 * Runtime这个类就是使用单例设计模式
 */
public class Demo {
    public static void main(String[] args) throws IOException {
        Runtime runtime = Runtime.getRuntime();
        Process process = runtime.exec("ipconfig");
        InputStream inputStream = process.getInputStream();
        byte[] bytes = inputStream.readAllBytes();
        System.out.println(new String(bytes,"gbk"));
    }
}
